Skip to content

BLD: Add useful shortcuts to Makefile #3803

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 18, 2013

Conversation

jtratner
Copy link
Contributor

@jtratner jtratner commented Jun 7, 2013

Add some shortcuts to make it easier to develop with pandas.

now there's a set of commands in the Makefile in the top-level pandas directory with the following functionality

  • make clean will delete the build and dist directories + all *.pyc and *.so files
  • make clean_pyc just removes *.pyc files
  • make build will build extensions inplace
  • make develop will install pandas in your environment but will place a link to the dev dir so that you can make changes and they will show up immediately
  • make doc will build the documentation from scratch (erases generated and build directories)

@jreback
Copy link
Contributor

jreback commented Jun 7, 2013

@jtratner looks good
@cpcloud @hayd
anyone have an issue with this?

@cpcloud
Copy link
Member

cpcloud commented Jun 7, 2013

can u add

doc: develop
    -rm -rf doc/source/generated
    -cd doc
    -python make.py clean
    -python make.py html
    -cd ..

or something like it? i'm always building docs now that it's like a second mini testing suite :)

@jreback
Copy link
Contributor

jreback commented Jun 7, 2013

the only thing is I always have to add my path to doc/source/conf.py for some reason whenver I need to builds docs...e.g.

sys.path.insert(0,'/home/jreback/pandas'

or is this just me being stupid?

@cpcloud
Copy link
Member

cpcloud commented Jun 7, 2013

hm i don't get that, but i remember i used to get it on another project and do the same thing to my path, i never changed it so i'm not sure what the fix is

@jtratner
Copy link
Contributor Author

jtratner commented Jun 7, 2013

@cpcloud I added the task you recommended. Suggestion for you too: you might try installing guard and then using this Guardfile that I wrote up for the pandas repo. This should, in general, automatically run tests as you change files (and I added a part so that it would automatically rebuild the docs if you make changes). That said, are you sure that you want the doc task to also call develop? That causes it to remove the build folder, rebuild all the extensions and then install it again into your site-packages. You might want to remove develop and keep it separate.

@jtratner
Copy link
Contributor Author

jtratner commented Jun 7, 2013

Hold on - don't merge this, made a mistake in the Makefile.

@cpcloud
Copy link
Member

cpcloud commented Jun 7, 2013

@jtratner ur right def should remove the develop dependency. i'm not sure i want tests run every time i change a file, that would lead to so many breaks since i cannot write correct code the first time every time... ;) i like pyflakes on save in vim cuz it's fast and catches the stupid errors whereas i leave crazy runtime errors and bugs to nose...maybe not the most efficient. sometimes i use pep8 too but because all of the interesting files in pandas are so not pep8 compliant that's slow too :(

@cpcloud
Copy link
Member

cpcloud commented Jun 7, 2013

on second thought i'm not sure i like removing the extensions since they take so long to build what about just removing pyc and having another make directive that removes the extensions explicitly like make rmbuild or something. i often rebase and then build and maybe a SINGLE extension has changed so i just want to do develop on pandas right after i pull in those changes...make sense? any other opinions?

@jtratner
Copy link
Contributor Author

jtratner commented Jun 8, 2013

Sure, I think that makes sense . make clean handles removing the build file, so that doesn't need to change. I also added clean_pyc as a target to the clean task.

@jtratner
Copy link
Contributor Author

jtratner commented Jun 8, 2013

I believe this all works now.

-cd doc; \
python make.py clean; \
python make.py html
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jtratner no cd .. here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cpcloud Makefile runs it in a separate thread, that's why all of the last 3 statements are actually on one line. (with line continuation characters and semi-colons). Try removing the "; " from the end of line 27 and you'll see that it complains about being in the wrong folder, because it executes the cd in a separate thread.

@cpcloud
Copy link
Member

cpcloud commented Jun 8, 2013

@jtratner oh right I forgot about this feature/quirk. I haven't used make in a while.

@jtratner
Copy link
Contributor Author

jtratner commented Jun 8, 2013

definitely a quirk

On Sat, Jun 8, 2013 at 1:15 AM, Phillip Cloud [email protected]:

@jtratner https://github.com/jtratner oh right I forgot about this
feature/quirk. I haven't used make in a while.


Reply to this email directly or view it on GitHubhttps://github.com//pull/3803#issuecomment-19143307
.

@cpcloud
Copy link
Member

cpcloud commented Jun 8, 2013

@jtratner just noticed that the doc directive should contain -rm -rf doc/build as well.

@cpcloud
Copy link
Member

cpcloud commented Jun 8, 2013

wonder if there are any other mindless tasks we can delegate to the gods of make.

@jtratner
Copy link
Contributor Author

jtratner commented Jun 8, 2013

@cpcloud we could improve make test since it only tests sparse (which makes little sense to me).

I was thinking it could be improved to:

test: build
     -./test_fast.sh

Another option could be:

perf: build
      -./test_perf.sh

@cpcloud
Copy link
Member

cpcloud commented Jun 8, 2013

test_fast.sh yields a 3.5x ish speedup for me. i go back and forth with how useful that is since you might just add more time having to fix bugs that weren't caught by the "fast" and you still have to run the "slow" one at that point anyway.

there's a psychological benefit to not having to wait 3.5 minutes for the full test suite to finish especially if i didn't make any changes in the things that run slow...HOWEVER of course you could have touched something in the "fast" parts that breaks something in the "slow" parts.

can u have args to make directives? like make test fast (run ./test_fast) and make test (default test everything) note that both test.sh and test_fast.sh take args i don't remember how make deals with passing arguments from the shelll....

@jtratner
Copy link
Contributor Author

jtratner commented Jun 8, 2013

@cpcloud it's tricky to add arguments to Makefiles. I'd be okay with adding test_fast, which runs test_fast.sh and test which runs all tests, but going in any more detail will probably end up making the Makefile more fragile.

I'm sticking to using a Guardfile with pandas, because it makes it so you don't have to think about running the tests :)

@cpcloud
Copy link
Member

cpcloud commented Jun 8, 2013

ur right that looks outrageous

@jtratner
Copy link
Contributor Author

jtratner commented Jun 8, 2013

@cpcloud so, which tasks do you want here?

@cpcloud
Copy link
Member

cpcloud commented Jun 8, 2013

up to u but i'm partial to test_fast and test...b4 by "sparse" i thought u meant test_fast not only testing sparse data strcts...my bad

@cpcloud
Copy link
Member

cpcloud commented Jun 8, 2013

although i think u could prolly leave em out since it's less to type ./test_<TAB>

@cpcloud
Copy link
Member

cpcloud commented Jun 9, 2013

this looks good 2 me...@jreback ?

@jreback
Copy link
Contributor

jreback commented Jun 9, 2013

this is ok too

@cpcloud
Copy link
Member

cpcloud commented Jun 9, 2013

@jtratner anything else b4 i merge?

@jtratner
Copy link
Contributor Author

jtratner commented Jun 9, 2013

@cpcloud do you think that build should really be silenced? (i.e., if it encounters an error it ignores it) Maybe it makes more sense to have it fail loudly.

@cpcloud
Copy link
Member

cpcloud commented Jun 9, 2013

not sure what u mean...is that what the "-" does?

@jtratner
Copy link
Contributor Author

jtratner commented Jun 9, 2013

@cpcloud Yes. so right now, if you did make develop and make build failed with an error code, it would still try to run python setup.py develop even though the build didn't work.

@cpcloud
Copy link
Member

cpcloud commented Jun 9, 2013

i would say always propagate errors since you don't want things to just blindly continue if something failed...:) even though errors are of course annoying better to fail fast then fail much, much later after 1000 things have gone wrong! i just thought that the "-" was make syntax for "do this in a shell" or some kind of strange legacy syntax..

@cpcloud
Copy link
Member

cpcloud commented Jun 9, 2013

@jtratner Sorry about that. Not a huge make user. I usually end up just writing bash functions to do my bidding...

@cpcloud
Copy link
Member

cpcloud commented Jun 18, 2013

shall i merge?

@jreback
Copy link
Contributor

jreback commented Jun 18, 2013

ok

cpcloud added a commit that referenced this pull request Jun 18, 2013
BLD: Add useful shortcuts to Makefile
@cpcloud cpcloud merged commit 95ca455 into pandas-dev:master Jun 18, 2013
@cpcloud
Copy link
Member

cpcloud commented Jun 18, 2013

thanks @jtratner

@jreback
Copy link
Contributor

jreback commented Jun 18, 2013

@cpcloud do you want to update the wiki page with some of these types of things? (e.g. make a dev page) and add the info from the note to selves issues? (or link to it)

@jtratner
Copy link
Contributor Author

This isn't totally updated so hopefully you didn't merge this yet :)
On Jun 18, 2013 6:37 PM, "jreback" [email protected] wrote:

@cpcloud https://github.com/cpcloud do you want to update the wiki page
with some of these types of things? (e.g. make a dev page) and add the info
from the note to selves issues? (or link to it)


Reply to this email directly or view it on GitHubhttps://github.com//pull/3803#issuecomment-19648076
.

@cpcloud
Copy link
Member

cpcloud commented Jun 18, 2013

whoops didn't realize. can u submit another pr with the changes. sorry i thought u were finished

@cpcloud
Copy link
Member

cpcloud commented Jun 18, 2013

@jreback i like the wiki but i feel like it won't ever get used. if we are going to use it i think contributing.md should live there as well as a link to #3156 plus 2-3 git workflows i will write these...that way i can close the issue on the website repo + consolidate these things. the previous link on the website should then link to the wiki. sound ok?

@jreback
Copy link
Contributor

jreback commented Jun 18, 2013

I think contributing is fine to move to wiki, e.g. maybe make a contributing type page, and advanced pages or something.....let's start and see how it goes....sort of like an easy refernce page

ideally could have people actually contribute to it (e.g. recipes)....but let's start small

@cpcloud
Copy link
Member

cpcloud commented Jun 18, 2013

i think it still has to be in the top level so that peopl will get that message on gh when they are opening an issue

@jtratner
Copy link
Contributor Author

What if we had a github pages branch instead? It would be on a separate
branch so changes to it wouldn't pollute master with commits, but could
still discuss with pull requests...
On Jun 18, 2013 7:01 PM, "Phillip Cloud" [email protected] wrote:

i think it still has to be in the top level so that peopl will get that
message on gh when they are opening an issue


Reply to this email directly or view it on GitHubhttps://github.com//pull/3803#issuecomment-19649429
.

@jtratner
Copy link
Contributor Author

And I'd volunteer to set it up if that's helpful
On Jun 18, 2013 7:07 PM, [email protected] wrote:

What if we had a github pages branch instead? It would be on a separate
branch so changes to it wouldn't pollute master with commits, but could
still discuss with pull requests...
On Jun 18, 2013 7:01 PM, "Phillip Cloud" [email protected] wrote:

i think it still has to be in the top level so that peopl will get that
message on gh when they are opening an issue


Reply to this email directly or view it on
GitHubhttps://github.com//pull/3803#issuecomment-19649429
.

@jreback
Copy link
Contributor

jreback commented Jun 18, 2013

go 4 it....

@jtratner
Copy link
Contributor Author

Not sure I can, I think you have to have commiter access to setup. I can
definitely write things up and such.
On Jun 18, 2013 7:12 PM, "jreback" [email protected] wrote:

go 4 it....


Reply to this email directly or view it on GitHubhttps://github.com//pull/3803#issuecomment-19649867
.

@jreback
Copy link
Contributor

jreback commented Jun 18, 2013

ok...i'll create a couple of pages....'Contributing'? 'Developers'? to start off (can always rename later)

@cpcloud
Copy link
Member

cpcloud commented Jun 18, 2013

sounds good to me.

@jtratner
Copy link
Contributor Author

Ditto
On Jun 18, 2013 7:36 PM, "Phillip Cloud" [email protected] wrote:

sounds good to me.


Reply to this email directly or view it on GitHubhttps://github.com//pull/3803#issuecomment-19650712
.

@jtratner
Copy link
Contributor Author

Would you want to move over the developing page from the docs? (or at least
start to do that)
On Jun 18, 2013 7:38 PM, [email protected] wrote:

Ditto
On Jun 18, 2013 7:36 PM, "Phillip Cloud" [email protected] wrote:

sounds good to me.


Reply to this email directly or view it on GitHubhttps://github.com//pull/3803#issuecomment-19650712
.

@jreback
Copy link
Contributor

jreback commented Jun 18, 2013

real basic: https://github.com/pydata/pandas/wiki

copy for now (so its inline); have to link the dev page docs to this and main docs too

@jtratner
Copy link
Contributor Author

@jreback Sorry, this isn't quite what I mean. I mean you should look at this - https://help.github.com/articles/user-organization-and-project-pages

I can definitely create wiki pages. The upside of a github page is that it adds a new branch gh-page that you can push in order to add docs to the project. That way, you can keep using the same pull requests to add to the docs and keep everyone in the loop (which is what it sounded like you wanted).

@jreback
Copy link
Contributor

jreback commented Jun 19, 2013

I see what u mean

but I think u can push/ pull wiki pages too
and I believe anyone can edit them (I see u added some exception stuff)

I like that its right off of the github main menu

hg-pages sounds similar to docs, right ?

@jtratner
Copy link
Contributor Author

@jreback yes, I can definitely edit wiki pages. It sounded like you wanted people to be notified when there were changes to the dev docs/wiki. Do you get notified on wiki changes?

@cpcloud
Copy link
Member

cpcloud commented Jun 19, 2013

i haven't ever gotten any notifications about it

@jtratner
Copy link
Contributor Author

@cpcloud @jreback right, so that would be the major advantage of ghpages (that you would get notifications). Plus, I'm pretty sure you could set it up as a subdomain/subdirectory of pandas.pydata.org. I dunno, maybe pandas.pydata.org/cookbook? Whatever you all want to do.

@cpcloud
Copy link
Member

cpcloud commented Jun 19, 2013

what do u mean fewer notifications is good!?!? :P

@jtratner
Copy link
Contributor Author

lol, I have no preference either way - easier to make sure that everything is right when using gh-pages, but less need to merge branches with wiki. :P

@cpcloud
Copy link
Member

cpcloud commented Jun 19, 2013

i think maybe the wiki for now...gh-pages seems very similar to docs, plus i can just go and edit the wiki anytime i want to write something rather than opening vim, writing, committing, pushing etc.

@jtratner
Copy link
Contributor Author

sounds good...can I push new updates to this or do I need to make a new PR?

@cpcloud
Copy link
Member

cpcloud commented Jun 19, 2013

should make a new pr. u can use the same branch tho

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants